//
//  RCHttpRequestSerialization.h
//  RCNetRequestProject
//
//  Created by kabu on 2017/7/18.
//  Copyright © 2017年 RC. All rights reserved.
//

#import <Foundation/Foundation.h>
@protocol RCURLRequestSerialization <NSObject>
- (NSMutableURLRequest*)requestBySerialization:(NSMutableURLRequest*)request params:(id)aParams error:(NSError * __autoreleasing *)error;
@end
@interface RCFormData : NSObject
+ (NSMutableData*)formData:(NSData*)data parameters:(id)parameters mimeType:(NSString*)mimeType fileName:(NSString*)fileName name:(NSString*)name;
@end


@interface RCHttpRequestSerialization : NSObject<RCURLRequestSerialization>
@property (readonly, nonatomic, strong) NSDictionary <NSString *, NSString *> *httpRequestHeaders;
@property (nonatomic, assign) NSStringEncoding stringEncoding;
@property (assign, nonatomic) NSTimeInterval timeoutInterval;
@property (assign, nonatomic) NSURLRequestCachePolicy cachePolicy;
+ (instancetype)serializer;
- (void)setValue:(NSString*)value forHttpHeader:(NSString*)field;
- (NSString*)valueForHttpHeader:(NSString*)field;
- (NSMutableURLRequest *)requestWithMethod:(NSString *)method URLString:(NSString *)URLString parameters:(id)parameters error:(NSError * __autoreleasing *)error;
- (NSMutableURLRequest *)requestWithFormData:(NSData*)data urlString:(NSString*)URLString parameters:(id)parameters fileName:(NSString*)fileName name:(NSString*)name mimeType:(NSString*)mimeType;
@end
@interface RCJsonRequestSerialization : RCHttpRequestSerialization

@property (nonatomic, assign) NSJSONWritingOptions writingOptions;

+ (instancetype)serializerWithWritingOptions:(NSJSONWritingOptions)writingOptions;
@end
